import { axios as request  } from '@/utils/request'
import qs from 'qs'

export function get({params}) {
  return request({
    url: 'api/pick/finish?' + qs.stringify(params, {indices: false, encode: false}),
    method: 'get',
  })
}

export default {
  //提车保存
  savePick(params) {
    return request({
      url: 'api/pick/multi-pick',
      method: 'post',
      data: params
    })
  },
  //免费提短
  shortening(codeId) {
    return request({
      url: "api/pick/pick-free/" + codeId,
      method: "post"
    });
  },
  //提交验车
  verify(params) {
    return request({
      url: 'api/verify',
      method: 'put',
      data: params
    })
  },
  updataPick(params) {
    return request({
      url: 'api/pick',
      method: 'put',
      data: params
    })
  },
  deleteDept(codeId) {
    return request({
      url: "api/dept/" + codeId,
      method: "DELETE"
    });
  },
  //获取验车信息
  gegGerifyData(params) {
    return request({
      url: 'api/verify/' + params,
      method: 'get',
    })
  },
  //提车入库
  inWarehouse(params) {
    return request({
      url: 'api/pick/stock/' + params.orderId,
      method: 'post',
      data: params
    })
  },
  //查询费用 api/extra-fee/{orderId}/list
  getExtraFee(orderId) {
    return request({
      url: 'api/extra-fee/' + orderId + '/list',
      method: 'get',
    })
  },
  //新增费用
  addExtraFee(params) {
    return request({
      url: 'api/extra-fee',
      method: 'post',
      data: params
    })
  },
  //修改费用
  updataExtraFee(params) {
    return request({
      url: 'api/extra-fee',
      method: 'put',
      data: params
    })
  },
};